package com.qihonghr.ui;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TabHost;

/**
 * Created by dev on 13-11-20.
 */
public class MainActivity extends TabActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // 应用程序窗体显示状态操作该参数表示无标题
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        // 去掉任务栏
//        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

        // 这句话一定在上面两句之后
        setContentView(R.layout.main_activity);

        setupTabs();
    }

    private void setupTabs() {
        Resources res = getResources();
        TabHost tabHost = getTabHost();

        TabHost.TabSpec spec;
        Intent intent;

        intent = new Intent().setClass(this, JobActivity.class);
        spec = tabHost.newTabSpec("job")
                .setIndicator("招工信息", res.getDrawable(R.drawable.ic_launcher))
                .setContent(intent);
        tabHost.addTab(spec);

        intent = new Intent().setClass(this, TalentsWantedActivity.class);
        spec = tabHost.newTabSpec("talents_wanted")
                .setIndicator("招贤纳士", res.getDrawable(R.drawable.ic_launcher))
                .setContent(intent);
        tabHost.addTab(spec);

        intent = new Intent().setClass(this, ResumeActivity.class);
        spec = tabHost.newTabSpec("resume")
                .setIndicator("我的简历", res.getDrawable(R.drawable.ic_launcher))
                .setContent(intent);
        tabHost.addTab(spec);
    }

    @Override
    protected void onResume() {
        super.onResume();
        getTabHost().setCurrentTab(0);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
